package com.demo.v7;

public class RbTreeMain {

	private static final int a[] = { 10, 40, 30, 60, 90, 70, 20, 50, 80, 5 };

	public static void main(String[] args) throws Exception {
		int i, ilen = a.length;
		RbTree<Integer> tree = new RbTree<Integer>();

		System.out.printf("== 原始数据: ");
		for (i = 0; i < ilen; i++){
			System.out.printf("%d ", a[i]);
		}
		System.out.printf("\n");

		for (i = 0; i < ilen; i++) {
			tree.insert(a[i]);
			System.out.printf("== 添加节点: %d\n", a[i]);
			System.out.printf("== 树的详细信息: \n");
			tree.print();
			System.out.printf("\n");
		}

		System.out.printf("== 树的详细信息: \n");
		tree.print();
		System.out.printf("\n");
	}

}
